<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>后台管理系统</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
 <link rel="stylesheet" href="http://36ki.oss-cn-shanghai.aliyuncs.com/video/css/global.css?t=1488795362026" media="all">
    <link rel="stylesheet" href="http://36ki.oss-cn-shanghai.aliyuncs.com/video/css/layui.css?t=1488795362026"  >
    <link rel="stylesheet" href="http://36ki.oss-cn-shanghai.aliyuncs.com/video/css/upload.css?t=1488795362026"  >

    <script src="http://36ki.oss-cn-shanghai.aliyuncs.com/video/js/jquery.js"></script>


    <link href="http://36ki.oss-cn-shanghai.aliyuncs.com/video/css/select2.min.css" rel="stylesheet" />
    <script src="http://36ki.oss-cn-shanghai.aliyuncs.com/video/js/select2.min.js"></script>

</head>
<body>
<div class="layui-layout layui-layout-admin">
		<div class="layui-header header header-demo">
				<div class="layui-main"> <a class="logo" href="/"> </a>
						<ul class="layui-nav" pc>
								<li class="right"> <span> 用户：jiadangwei</span><a href="/doc/" class="out">退出</a> </li>
						</ul>
				</div>
		</div>
		<div class="layui-side layui-bg-black">
				<div class="layui-side-scroll">
						<ul class="layui-nav layui-nav-tree site-demo-nav">
								<li class="layui-nav-item layui-nav-itemed"> <a class="javascript:;" href="javascript:;">开发工具</a>
										<dl class="layui-nav-child">
												<dd class=""> <a href="/demo/button.html">按钮组</a> </dd>
												<dd class=""> <a href="/demo/form.html">表单集合</a> </dd>
												<dd class=""> <a href="/demo/nav.html">导航与面包屑</a> </dd>
										</dl>
								</li>
								<li class="layui-nav-item layui-nav-itemed"> <a class="javascript:;" href="javascript:;">基本元素</a>
										<dl class="layui-nav-child">
												<dd class=""> <a href="/demo/button.html">按钮组</a> </dd>
												<dd class=""> <a href="/demo/form.html">表单集合</a> </dd>
												<dd class=""> <a href="/demo/nav.html">导航与面包屑</a> </dd>
										</dl>
								</li>
								<li class="layui-nav-item" style="height: 30px; text-align: center"></li>
						</ul>
				</div>
		</div>
		<div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
				<div class="layui-body layui-tab-content site-demo site-demo-body">
						<div class="mian"> <a class="layui-btn layui-btn-small layui-btn-danger" href="机构管理.html">返回机构管理</a>
								<form class="layui-form enen" action="../../up.php" name=theform>
										<div class="title">机构编辑</div>
										<div class="layui-form-item">
												<label class="layui-form-label">上传视频：</label>
												<div class="layui-input-block up_video">
														<input type="radio" name="myradio" value="random_name"  checked=true style="display:none"/>
														<div id="ossfile">你的浏览器不支持flash,Silverlight或者HTML5！</div>
														<div id="container"><a id="selectfiles" href="javascript:void(0);" class='btn'>选择文件</a> <a id="postfiles" href="javascript:void(0);" class='btn'>开始上传</a> </div>
												</div>
										</div>
										
										<div class="layui-form-item">
												<div class="layui-input-block">
														<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
														<button type="reset" class="layui-btn layui-btn-primary">重置</button>
												</div>
										</div>
								</form>
						</div>
				</div>
		</div>
		<div class="layui-footer footer footer-demo">
				<div class="layui-main">
						<p>2017 &copy; <a href="/">layui.com</a> MIT license</p>
				</div>
		</div>
		<div class="site-tree-mobile layui-hide"> <i class="layui-icon">&#xe602;</i> </div>
		<div class="site-mobile-shade"></div>
</div>
<script src="layui.js"></script> 
<script src="js/fun.js"></script> 
<script type="text/javascript" src="js/lib/crypto1/crypto/crypto.js"></script> 
<script type="text/javascript" src="js/lib/crypto1/hmac/hmac.js"></script> 
<script type="text/javascript" src="js/lib/crypto1/sha1/sha1.js"></script> 
<script type="text/javascript" src="js/lib/base64.js"></script> 
<script type="text/javascript" src="js/lib/plupload-2.1.2/js/plupload.full.min.js"></script> 
<script type="text/javascript" src="js/upload.js"></script> 
<script>
$(".btn_upload").each(function(index, element) {
	var btn=$(this).find("img");
	var file=$(this).find(".layui-upload-file");
	btn.click(function(){
		
		window.self=$(this)
	})
	layui.use('upload', function(){
	  layui.upload({
		url: 'json/upload.php'
		,elem: file //指定原始元素，默认直接查找class="layui-upload-file"
		,method: 'post' //上传接口的http类型
		,success: function(res){
			$(window.self).parents(".btn_upload").find("[type=hidden]").val(res.data.src)
			$(window.self).parents(".btn_upload").find("img").attr("src",res.data.src)
		}
	  });
	});
});
layui.use('form', function(){
  var form = layui.form();
  form.on('switch(switchTest)', function(data){
    layer.tips('开关checked：'+ (this.checked ? 'true' : 'false'), data.othis)
  });
  //监听提交
  form.on('submit(formDemo)', function(data){
    //layer.msg(JSON.stringify(data.field));
	$.ajax({
		url: "json/bm.php",
		data:data.field,
		type: "POST",
		dataType: "json",
		success: function(data) {
			layer.msg(data.resmsg);
		
		},
		error: function(er) {
			BackErr(er);
		}
	});
    return false;
  });
});
function uploadCallback(up, file, info){
	//将视频文件名字放到隐藏域
	//
	$("#"+$(file.id).selector).find(".videoName").val(validate(get_uploaded_object_name(file.name)).replace(/vod\//g," "))
	 document.getElementById(file.id).getElementsByTagName('b')[0].innerHTML = '上传成功, 文件名字:' + get_uploaded_object_name(file.name);
}
</script>
</body>
</html>
